package org.canaan.auth2.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;


public class User implements Serializable,UserDetails {
	private static final long serialVersionUID = -6443527534882009326L;

	private String fId; //
	private String fName; // 名称
	private String fAccount; // 登录账号
	private String fPassword; // 密码
	private String fStatus; // 状态，默认ENABLE
	private String fPhone; // 电话
	private String fEmail; // 邮箱
	private String fGender; // 性别，默认 UNKNOW
	private String fPinYin; // 拼音
	private String fDescr; // 备注
	private String fAvatar; // 头像
	private String fCreater; // 创建人
	private Date fCreateDate; // 创建日期
	private String fEditor; // 修改人
	private Date fEditDate; // 修改日期
	
	public String getfId() {
		return fId;
	}
	public void setfId(String fId) {
		this.fId = fId;
	}
	public String getfName() {
		return fName;
	}
	public void setfName(String fName) {
		this.fName = fName;
	}
	public String getfAccount() {
		return fAccount;
	}
	public void setfAccount(String fAccount) {
		this.fAccount = fAccount;
	}
	public String getfPassword() {
		return fPassword;
	}
	public void setfPassword(String fPassword) {
		this.fPassword = fPassword;
	}
	public String getfStatus() {
		return fStatus;
	}
	public void setfStatus(String fStatus) {
		this.fStatus = fStatus;
	}
	public String getfPhone() {
		return fPhone;
	}
	public void setfPhone(String fPhone) {
		this.fPhone = fPhone;
	}
	public String getfEmail() {
		return fEmail;
	}
	public void setfEmail(String fEmail) {
		this.fEmail = fEmail;
	}
	public String getfGender() {
		return fGender;
	}
	public void setfGender(String fGender) {
		this.fGender = fGender;
	}
	public String getfPinYin() {
		return fPinYin;
	}
	public void setfPinYin(String fPinYin) {
		this.fPinYin = fPinYin;
	}
	public String getfDescr() {
		return fDescr;
	}
	public void setfDescr(String fDescr) {
		this.fDescr = fDescr;
	}
	public String getfAvatar() {
		return fAvatar;
	}
	public void setfAvatar(String fAvatar) {
		this.fAvatar = fAvatar;
	}
	public String getfCreater() {
		return fCreater;
	}
	public void setfCreater(String fCreater) {
		this.fCreater = fCreater;
	}
	public Date getfCreateDate() {
		return fCreateDate;
	}
	public void setfCreateDate(Date fCreateDate) {
		this.fCreateDate = fCreateDate;
	}
	public String getfEditor() {
		return fEditor;
	}
	public void setfEditor(String fEditor) {
		this.fEditor = fEditor;
	}
	public Date getfEditDate() {
		return fEditDate;
	}
	public void setfEditDate(Date fEditDate) {
		this.fEditDate = fEditDate;
	}
	
	@Override
	public Collection<? extends GrantedAuthority> getAuthorities() {
		ArrayList<Role> roles = new ArrayList<>();
		Role role = new Role();
		roles.add(role);
		return roles;
	}
	@Override
	public String getPassword() {
		return getfPassword();
	}
	@Override
	public String getUsername() {
		return getfAccount();
	}
	@Override
	public boolean isAccountNonExpired() {
		return true;
	}
	@Override
	public boolean isAccountNonLocked() {
		return true;
	}
	@Override
	public boolean isCredentialsNonExpired() {
		return true;
	}
	@Override
	public boolean isEnabled() {
		return true;
	}
	
}
